/**
 * 
 */
package es.ats.codington.festival.JSon;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;

/**
 * @author equipo bit
 *
 */
public class JSonAccess {

	 Object obj;
	 JSONObject jsonObject;
	
	public JSonAccess() {
		openJson();
		
	}

	public void openJson() {
		JSONParser parser=new JSONParser();
		 try {
			obj = parser.parse(new FileReader("src\\es\\ats\\codington\\festival\\json\\JSonDataDB.json"));
													
			jsonObject = (JSONObject) obj;
		 } catch (FileNotFoundException e) {
			
			e.printStackTrace();
		} catch (IOException e) {
			
			e.printStackTrace();
		} catch (ParseException e) {
			e.printStackTrace();
		} 
	}
	
		 public String getBDUrl(){
			
			String url = (String) jsonObject.get("url");
			 return url;
			} 
		
		 public String getBDUser(){
			 String user = (String) jsonObject.get("user");
			 return user;
			 
		} 
		 
		 public String getBDPass(){
			 String pass = (String) jsonObject.get("pass");
			 return pass;
			} 
		 
		 public String getBDDriver(){
			 String driver = (String) jsonObject.get("driver");
			 return driver;
			} 
		 
		
		 
	}
	
	
	
	
	

